package com.huilang.demo1;

public class SmartAppliancesFacade {
    private  TV tv;
    private AirCondition airCondition;
    private Light light;
    public SmartAppliancesFacade() {
        tv = new TV();
        airCondition = new AirCondition();
        light = new Light();
    }

    public void on() {
        tv.on();
        airCondition.on();
        light.on();
    }
    public void off() {
        tv.off();
        airCondition.off();
        light.off();
    }

    public void m(String s) {
        if (s.contains("打开")) {
            on();
        }else if (s.contains("关闭")) {
            off();
        }

    }
}
